package org.algorithm.biubiu.wheel_1.字符串;

/**
 * @author jiazhaoxin
 * @Date 2022/2/22
 * @Desc
 */
public class Excel表列序号 {


    public int titleToNumber(String s) {
        int ans = 0;
        for(int i=0;i<s.length();i++) {
            int num = s.charAt(i) - 'A' + 1;
            ans = ans * 26 + num;
        }
        return ans;
    }
}
